<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>垃圾邮件列表</title>
	
	<link href="/oas/css/style.css" rel="stylesheet" type="text/css" />
	<style type="text/css">
		table{border-collapse:separate;text-align:center;width:90%;}
		.operation {border:0;background-color:transparent;text-decoration:underline;}
	</style>
	<script type="text/javascript" src="/oas/js/jquery-1.11.3.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){},function handle(status,eid){
			var con=confirm("确实执行此操作？");
			if(con){
				$("#ajax").load("/oas/email/spam?confirm="+status+"&eid="+eid);
			}
		})
	</script>
</head>
<body>
	<div class="action">
		<div class="t">
			垃圾邮件列表
		</div>
		<div class="pages">
			<form onsubmit="return confirmRestore()">
				<table>
					<tr>
						<th>邮件标题</th>
						<th>内容</th>
						<th>是否已读</th>
						<th>时间</th>
						<th>操作</th>
					</tr>
					<s:iterator value="#request.emails" status="eStatus" id="email">
						<tr>
						<td><s:property value="#email.title"/></td>
						<td><s:property value="#email.details"/></td>
						<s:if test="#email.isRead"><td>已读</td></s:if>
						<s:else><td>未读</td></s:else>
						<td><s:property value="#email.sendTime.toString().substring(0,10)"/></td>
						<td>
							<a href="#" onclick="handle(false,<s:property value='#email.eid'/>)" class="operation">还原</a>
							&nbsp;|&nbsp;
							<a href="#" onclick="handle(true,<s:property value='#email.eid'/>)" class="operation">删除</a>
						</td>
					</tr>
					</s:iterator>
				</table>
			</form>
				
		</div>
	</div>
</body>
</html>